Test Series - java script

Test Number 46/92

Q: The main purpose of JavaScript in web browser is to ___________
A. Creating animations and other visual effects
B. User Interface
C. Visual effects
D. User experience
Solution: JavaScript can help to facilitate that experience, for example by:
Creating animations and other visual effects to subtly guide a user and help with page navigation
Sorting the columns of a table to make it easier for a user to find what she needs
Q: A JavaScript program can traverse and manipulate document content through __________
A. Element Object
B. Document Object
C. Both Element and Document Object
D. Data object
Solution: A JavaScript program can traverse and manipulate document content through the Document object and the Element objects it contains. It can alter the presentation of that content by scripting CSS styles and classes. The Element object represents an HTML element, like P, DIV, A, TABLE, or any other HTML element.
Q: The behaviour of the document elements can be defined by __________
A. Using document object
B. Registering appropriate event handlers
C. Using element object
D. Using data element
Solution: The JavaScript program can define the behavior of document elements by registering appropriate event handlers. A JavaScript program can traverse and manipulate document content through the Document object and the Element objects it contains.
Q: The service(s) that enables networking through scripted HTTP requests is __________
A. XMLHttpResponse
B. XMLRequest
C. XMLHttpRequest
D. XMLHttps
Solution: The best known advanced services is the XMLHttpRequest object, which enables networking through scripted HTTP requests. The XMLHttpRequest object can be used to request data from a web server.
Q: The HTML5 specification does not includes __________
A. Data storage
B. Graphics APIs
C. Other APIs for web apps
D. Networking
Solution: The HTML5 specification (which, at the time of this writing, is still in draft form) and related specifications are defining a number of other important APIs for web apps. These include data storage and graphics APIs.The data storage api can store data locally within the user’s browser.
Q: Which of the following is not an advanced services?
A. Data storage
B. Networking
C. XMLHttpRequest object
D. Graphics APIs
Solution: Data storage is used to store data locally on user’s computer and networking is used for connecting between different platforms.
Q: JavaScript code between a pair of “script” tags are called __________
A. Non-inline
B. External
C. Referenced
D. Inline
Solution: The 


Q: What is the programming philosophy that argues that content and behaviour should as much as possible be kept separate?
A. Unobtrusive JavaScript
B. Obtrusive JavaScript
C. Inherited JavaScript
D. Modular JavaScript
Solution: A programming philosophy known as unobtrusive JavaScript argues that content (HTML) and behavior (JavaScript code) should as much as possible be kept separate. According to this programming philosophy, JavaScript is best embedded in HTML documents using “script” elements with src attributes.
Q: Which of the following communicates with server-side CGI scripts through HTML form submissions and can be written without the use of JavaScript?
A. Static Web Pages
B. Interactive Web Pages
C. Conditional Web Pages
D. All web pages
Solution: An interactive web page can dynamically vary its content based on user preferences. Interactive web pages that communicate with server-side CGI scripts through HTML form submissions were the original “web application” and can be written without the use of JavaScript.

You Have Score    /10